package com.idnx.mynewsdemo.view;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.idnx.mynewsdemo.R;

public class MyActivity extends AppCompatActivity {
    private TextView lsjl;
    private TextView wdsp;
    private String userName;
    private TextView usname,back;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my);
        lsjl = findViewById(R.id.lsjl);
        wdsp = findViewById(R.id.wdsp);
        usname = findViewById(R.id.usname);
        back = findViewById(R.id.back);
        Intent intent = getIntent();
        userName = intent.getStringExtra("username");
        usname.setText("用户名：" + userName);
        lsjl.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent1 = new Intent();
                intent1.putExtra("username",userName);
                intent1.setClass(MyActivity.this, HistoryActivity.class);
                startActivity(intent1);
            }
        });
        wdsp.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent2 = new Intent();
                intent2.putExtra("username",userName);
                intent2.setClass(MyActivity.this, VideoPlayerActivity.class);
                startActivity(intent2);
            }
        });



        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}